refactor(installer): unify Vite+ setup into the global cli - #2611
refactor(installer): unify Vite+ setup into the global cli#2611liangmiQwQ wants to merge 21 commits into
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 072785da3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95c99baec5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 013777b09d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
One left problem might be #1338 (comment), but it is not a big deal, this PR already copies the original behavior, this could be reconsidered after this merged. |
|
@liangmiQwQ Can you describe whether all the various compatibility issues after this change have been taken into account? For example, whether users who have upgraded from the old version using Vite+ via the new install.sh are compatible. Or whether the new and old versions of setup-vp are compatible with install.sh, etc. |
|
CI failing is fixed in #2616 |
@fengmk2 I have intentionally considered compatibility issues during this refactor. Detailed compatibility table is included in the PR description. |
Registry bridge build (
|
| Package | Version |
|---|---|
vite-plus |
0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c |
@voidzero-dev/vite-plus-core |
0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c |
Install the Vite+ CLI built from this commit, then migrate a project:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/liangmiQwQ/vite-plus/8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c/packages/cli/install.sh | VP_PR_VERSION=2611 bash# Windows (PowerShell)
$env:VP_PR_VERSION="2611"; irm https://raw.githubusercontent.com/liangmiQwQ/vite-plus/8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c/packages/cli/install.ps1 | iexOr download the standalone Windows installer built from this commit:
| Architecture | Installer |
|---|---|
| x64 | vp-setup-x86_64-pc-windows-msvc.exe |
| Arm64 | vp-setup-aarch64-pc-windows-msvc.exe |
GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract vp-setup.exe, then run it against this preview build:
.\vp-setup.exe --version "0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c" --registry "https://registry-bridge.viteplus.dev/"After installing, upgrade the current project's vite-plus to this test build with:
vp migrateOr point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:
| Package manager | Registry config |
|---|---|
| npm / pnpm / Bun | .npmrc: registry=https://registry-bridge.viteplus.dev/ |
| Yarn (v2+) | .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/" |
Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):
{
"devDependencies": {
"vite-plus": "0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c",
"vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c"
}
}
Close #2406
Close #2338
Close #2170
Bash installer, PowerShell installer,
vp-setup.exe, andvp upgradenow share the target binary's setup code. Moving installation logic intovpreduces duplication and platform differences, and lets each new version own its setup changes.Installers download and verify the target, then let it install itself. A completion marker makes setup run on first launch and retry after failure. This also lets old
vp upgradereach the new setup through its existingvp env setup --refreshcall, while keeping its download and activation flow.Setup always creates
vpxandvprshims, usessystem-firstmode when users decline Node.js management, and reports failures back to the installers.Installers probe for self-setup support and fall back to the legacy implementations for older targets. Keeping those legacy installers accounts for the net line increase, even though the new scripts are much smaller (reduce more than 2500 line).
Here, “new” and “old” refer to the installers and
vpimplementations after and before this change. This PR does not changesetup-vp. 🟢 indicates a supported compatibility path; it does not imply that every historical version combination has been tested.current, and shims.vpvite-plus-self-setup-v1, then hands installation over to the target binary.vpvpenv setupinvocation triggers the new binary’s first-start setup.vp upgrade→ newvpenv setup --refreshcall triggers in-place setup, preserving configuration and rollback history.vp upgrade→ newvp, including same-version reinstallscurrentand refreshes the environment throughenv setup --refresh.setup-vpcalling the new install script~/.vite-plus, keeping PATH consistent.vp-setup.exe→ versions 0.3.0 and later🤖 Generated with Codex